<template>
  <div id="CheckeRgister">
    <van-form validate-first>
      <p class="title">农村房屋结构安全排查登记表</p>
      <p class="subTitle">房屋情况</p>
      <van-field v-model="formData.BH" placeholder="请输入编号" label="编号" />
      <van-field v-model="formData.MC" placeholder="请输入名称" label="名称" />
      <van-field v-model="formData.ZLDZ" placeholder="请输入坐落地址" label="坐落地址" />
      <van-field readonly clickable name="datetimePicker" v-model="formData.JGRQ" label="竣工日期" placeholder="请选择"
                 @click="showPickerq = true" />
      <van-popup v-model="showPickerq" position="bottom" get-container="#popup">
        <van-datetime-picker v-model="currentDate" type="date" title="选择年月日" @cancel="showPickerq = false"
                             @confirm="onConfirm" />
      </van-popup>
      <van-field readonly clickable name="picker" :value="formData.JGLX | inUseName(ENUM.JGLXARR)" label="结构类型" placeholder="请选择" @click="ENUM.JGLX = true" />
      <van-popup v-model="ENUM.JGLX" position="bottom" get-container="#popup">
        <van-picker show-toolbar value-key="DICNAME" :columns="ENUM.JGLXARR" @confirm="onConfirmJGLX"
                    @cancel="ENUM.JGLX = false" />
      </van-popup>
      <van-field v-model="formData.JZCS" placeholder="请输入建筑层数" label="建筑层数" />
      <van-field v-model="formData.DSCS" placeholder="请输入地上层数" label="地上层数" />
      <van-field v-model="formData.DXCS" placeholder="请输入地下层数" label="地下层数" />
      <van-field v-model="formData.ZJZMJ" placeholder="请输入总建筑面积" label="总建筑面积（㎡）" />
      <p class="subTitle">现场调查</p>
      <div v-for="(item,index) in form" >
        <van-radio-group     v-model="formData[item.key]">
          <p class="subTitle1" :style="{ 'font-weight': item.name1 ? 'bold' : 'none' }">{{ item.name }}</p>
          <p class="subTitle1" v-if="item.name1" >{{ item.name1 }}</p>
          <div
            v-for="(items , indexs) in item.child"
            :key="indexs+'child'"
          >
            <van-radio
              class="vanCheckbox"
              :name="items.name"
              label-disabled
              v-if="!items.child"
              @click="radioChange(items)"
              shape="square">
              {{ items.name }}
            </van-radio>
            <van-field
              v-if="items.name=='其他' && formData[item.key]=='其他'"
              v-model="formData[items.key]"
              rows="2"
              autosize
              type="textarea"
              placeholder="请输入内容"
              show-word-limit
            />
            <p
              class="vanCheckbox"
              v-if="items.child"
              style="padding: 10px 6px;"
            >
              {{ items.name }}
              <template v-if="items.child" >
                （<van-radio style="display: inline-flex" v-for="(ite,ind) in items.child" :key="ind+'ind'" :name="items.name+'_'+ite.name" shape="square">{{ ite.name }}</van-radio>）
              </template>
            </p>
          </div>
        </van-radio-group>
      </div>
      <p class="subTitle">鉴定情况</p>
      <van-radio-group v-model="formData.JDQK" >
        <div v-for="(items,index) in XCDC" :key="index" style="padding-top: 10px">
          <van-radio v-if="!items.child" class="vanCheckbox"  :name="items.name" label-disabled shape="square">
            {{ items.name }}
          </van-radio>
          <template v-if="items.child" >
            <span>{{ items.name }}</span>
            （<van-radio v-for="(ite,ind) in items.child" :key="ind" :name="items.name+ite.name" shape="square"
                        style="display: inline-flex">{{ ite.name }}
          </van-radio>）
          </template>
        </div>
      </van-radio-group>

    </van-form>
  </div>
</template>

<script>
  import { QuerySignCallback } from '@/utils/api'
  export default {
    name: "CheckeRgister",
    data() {
      return {
        showPickerq: false,
        currentDate: new Date(),
        formData: {
          BH:'',
          MC:'',
          ZLDZ:'',
          JGRQ:'',
          JGLX:'',
          JZCS:'',
          DSCS:'',
          DXCS:'',
          ZJZMJ:'',
          DJJC:'',
          // DJJC_CJLF:'',
          // DJJC_HTQK:'',
          DJJC_QT:'',
          // L:'',
          L_GJHYT:'',
          // L_GJHYT_LF:'',
          // L_GJHYT_GJXS:'',
          L_M:'',
          // L_M_LF:'',
          // L_M_FXZS:'',
          // L_M_JDLJ:'',
          L_G:'',
          // L_G_LF:'',
          // L_G_XS:'',
          // L_G_JDLJ:'',
          // Z:'',
          Z_GJHYT:'',
          // Z_GJHYT_LF:'',
          // Z_GJHYT_GJXS:'',
          Z_M:'',
          // Z_M_LF:'',
          // Z_M_MXZS:'',
          // Z_M_JDPS:'',
          Z_G:'',
          // Z_G_LF:'',
          // Z_G_XS:'',
          // Z_G_JDLJ:'',
          Z_Z:'',
          // Z_Z_LF:'',
          // Z_Z_FHFH:'',
          // Z_Z_SCSL:'',
          // CZQT:'',
          CZQT_Z:'',
          // CZQT_Z_LF:'',
          // CZQT_Z_FHFH:'',
          // CZQT_Z_SCSL:'',
          CZQT_HYT:'',
          // CZQT_HYT_LF:'',
          // CZQT_HYT_LJXS:'',
          LG:'',
          XLSG_QT:'',
          // LG_LF:'',
          // LG_SL:'',
          // LG_LHPS:'',
          WG:'',
          // WG_LF:'',
          // WG_SL:'',
          // WG_LHPS:'',
          GZLJZC:'',
          // GZLJZC_XTQX:'',
          // GZLJZC_LJCPS:'',
          WHFGQT:'',
          // WHFGQT_LF:'',
          // WHFGQT_FHFH:'',
          // WHFGQT_WQSM:'',
          // WHFGQT_SCSL:'',
          DOORSW:'',
          // DOORSW_LHPS:'',
          WGW:'',
          // WGW_LHPS:'',
          FSGJ:'',
          // FSGJ_LHPS:'',
          DLSS:'',
          PSGD:'',
          // PSGD_LHPS:'',
          // PSGD_DS:'',
          RQGD:'',
          // RQGD_LHPS:'',
          FWCD:'',
          FWCD_QT:'',
          // FWCD_QT:'',
          XLSG:'',
          // XLSG_QT:'',
          HXQS:'',
          // HXQS_QT:'',
          JGCG:'',
          JCGZ:'',
          XSJG:'',
          // XSJG_QT:'',
          LSZH:'',
          // LSZH_QT:'',
          GLBG:'',
          // GLBG_QT:'',
          JDQK:'',
          // JDQK_YZJD:'',
          // WXMS:'',
          // DCDJJG:'',
          // DCRYQM:'',
          // SHRYQM:'',
          // ZGBM:'',
          // DJRQ:'',
          GLBG_QT:'',
          LSZH_QT:'',
          XSJG_QT:'',
          HXQS_QT:'',
          // XLSG_QT:'',
        },
        form: [
          {
            name: "地基基础",
            value: '',
            key: 'DJJC',
            child: [
              {
                name: '无异常',
                key: '',
                value: '1',
              },
              {
                name: '沉降裂缝',
                key: 'DJJC_CJLF',
                value: '2',
                child: [{
                  name: '轻微',
                  key: '',
                  value: '2-1',
                }, {
                  name: '一般',
                  key: '',
                  value: '2-2',
                }, {
                  name: '严重',
                  key: '',
                  value: '2-3',
                }]
              },
              {
                name: '明显倾斜',
                key: '',
                value: '3',
              },
              {
                name: '低洼积水',
                key: '',
                value: '4',
              },
              {
                name: '架空板代替回填情况',
                key: 'DJJC_HTQK',
                value: '5',
                child: [{
                  name: '轻微',
                  key: '',
                  value: '5-1',
                }, {
                  name: '一般',
                  key: '',
                  value: '5-2',
                }, {
                  name: '严重',
                  key: '',
                  value: '5-3',
                }]
              },
              {
                name: '其他',
                key: 'DJJC_QT',
                value: '6',
              }
            ]
          },
          {
            name: "梁",
            name1: "钢筋混凝土",
            key:'L_GJHYT',
            value: '',
            child: [
              {
                name: '无异常',
                key: '',
                value: '',
              },
              {
                name: '明显变形',
                value: '',
                key: '',
              },
              {
                name: '裂缝',
                key: '',
                value: '',
                child: [{
                  name: '轻微',
                  key: '',
                  value: '',
                }, {
                  name: '一般',
                  key: '',
                  value: '',
                }, {
                  name: '严重',
                  key: '',
                  value: '',
                }]
              },
              {
                name: '钢筋锈蚀、混凝土胀裂',
                key: '',
                value: '',
                child: [{
                  name: '轻微',
                  key: '',
                  value: '',
                }, {
                  name: '一般',
                  key: '',
                  value: '',
                }, {
                  name: '严重',
                  key: '',
                  value: '',
                }]
              }
            ]
          },
          {
            name: "木",
            key:'L_M',
            value: '',
            child: [{
              name: '无异常',
              key: '',
              value: '',

            }, {
              name: '明显变形',
              key: '',
              value: '',
            }, {
              name: '裂缝',
              key: '',
              value: '',
              child: [
                {
                  name: '轻微',
                  key: '',
                  value: '',
                }, {
                  name: '一般',
                  key: '',
                  value: '',
                }, {
                  name: '严重',
                  key: '',
                  value: '',
                }]
            }, {
              name: '腐朽蛀蚀',
              key: '',
              value: '',
              child: [{
                name: '轻微',
                key: '',
                value: '',
              }, {
                name: '一般',
                key: '',
                value: '',
              }, {
                name: '严重',
                key: '',
                value: '',
              }]
            }, {
              name: '节点连接',
              key: '',
              value: '',
              child: [{
                name: '轻微',
                key: '',
                value: '',
              }, {
                name: '一般',
                key: '',
                value: '',
              }, {
                name: '严重',
                key: '',
                value: '',
              }]
            }]
          },
          {
            name: "钢",
            key: 'L_G',
            value: '',
            child: [{
              name: '无异常',
              key: '',
              value: '',
            }, {
              name: '明显变形',
              key: '',
              value: '',
            }, {
              name: '裂缝',
              key: '',
              value: '',
              child: [{
                name: '轻微',
                key: '',
                value: '',
              }, {
                name: '一般',
                key: '',
                value: '',
              }, {
                name: '严重',
                key: '',
                value: '',
              }]
            }, {
              name: '锈蚀',
              key: '',
              value: '',
              child: [{
                name: '轻微',
                key: '',
                value: '',
              }, {
                name: '一般',
                key: '',
                value: '',
              }, {
                name: '严重',
                key: '',
                value: '',
              }]
            }, {
              name: '节点连接',
              key: '',
              value: '',
              child: [{
                name: '轻微',
                key: '',
                value: '',
              }, {
                name: '一般',
                key: '',
                value: '',
              }, {
                name: '严重',
                key: '',
                value: '',
              }]
            }]
          },
          {
            name: "柱",
            key: 'Z_GJHYT',
            value: '',
            name1: "钢筋混凝土",
            child: [{
              name: '无异常',
              key: '',
              value: '',
            }, {
              name: '明显变形',
              key: '',
              value: '',
            }, {
              name: '裂缝',
              key: '',
              value: '',
              child: [{
                name: '轻微',
                key: '',
                value: '',
              }, {
                name: '一般',
                key: '',
                value: '',
              }, {
                name: '严重',
                key: '',
                value: '',
              }]
            }, {
              name: '露筋锈蚀、混凝土胀裂',
              key: '',
              value: '',
              child: [{
                name: '轻微',
                key: '',
                value: '',
              }, {
                name: '一般',
                key: '',
                value: '',
              }, {
                name: '严重',
                key: '',
                value: '',
              }]
            }]
          },
          {
            name: "木",
            value: '',
            key: 'Z_M',
            child: [{
              name: '无异常',
              key: '',
              value: '',
            }, {
              name: '明显变形',
              key: '',
              value: '',
            }, {
              name: '裂缝',
              key: '',
              value: '',
              child: [{
                name: '轻微',
                key: '',
                value: '',
              }, {
                name: '一般',
                key: '',
                value: '',
              }, {
                name: '严重',
                key: '',
                value: '',
              }]
            }, {
              name: '腐朽蛀蚀',
              key: '',
              value: '',
              child: [{
                name: '轻微',
                key: '',
                value: '',
              }, {
                name: '一般',
                key: '',
                value: '',
              }, {
                name: '严重',
                key: '',
                value: '',
              }]
            }, {
              name: '节点连接',
              key: '',
              value: '',
              child: [{
                name: '轻微',
                key: '',
                value: '',
              }, {
                name: '一般',
                key: '',
                value: '',
              }, {
                name: '严重',
                key: '',
                value: '',
              }]
            }]
          },
          {
            name: "钢",
            value: '',
            key:'Z_G',
            child: [{
              name: '无异常',
              key: '',
              value: '',
            }, {
              name: '明显变形',
              key: '',
              value: '',
            }, {
              name: '裂缝',
              key: '',
              child: [{
                name: '轻微',
                key: '',
                value: '',
              }, {
                name: '一般',
                key: '',
                value: '',
              }, {
                name: '严重',
                key: '',
                value: '',
              }]
            }, {
              name: '锈蚀',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '节点连接',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "砖",
            key: 'Z_Z',
            value: '',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '明显变形',
              key: '',
            }, {
              name: '裂缝',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '风化粉化',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '受潮渗漏',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "承重墙体",
            name1: "砖（砌体）",
            key: 'CZQT_Z',
            value: '',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '明显变形',
              key: '',
            }, {
              name: '裂缝',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '风化粉化',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '受潮渗漏',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "混凝土",
            key: 'CZQT_HYT',
            value: '',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '明显变形',
              key: '',
            }, {
              name: '裂缝',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '露筋锈蚀',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "楼盖",
            value: '',
            key: 'LG',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '明显变形',
              key: '',
            }, {
              name: '裂缝',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '渗透',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '老化破损',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "屋盖",
            value: '',
            key: 'WG',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '明显变形',
              key: '',
            }, {
              name: '裂缝',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '渗透',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '老化破损',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "构造连接支撑",
            value: '',
            key: 'GZLJZC',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '先天缺失',
              key: '',
              child: [{
                name: '未设支撑',
                key: '',
              }, {
                name: '结构构造简易',
                key: '',
              }]
            }, {
              name: '明显变形',
              key: '',
            }, {
              name: '各构件连接处破损',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "围护结构",
            name1: "围护分隔墙体",
            key: 'WHFGQT',
            value: '',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '明显变形',
              key: '',
            }, {
              name: '裂缝',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '风化粉化',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '外墙饰面空鼓脱开',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '受潮渗漏',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "门窗",
            value: '',
            key: 'DOORSW',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '明显变形',
              key: '',
            }, {
              name: '老化破损',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "外挂物",
            value: '',
            key: 'WGW',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '明显变形',
              key: '',
            }, {
              name: '老化破损',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "附属构件",
            value: '',
            key:'FSGJ',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '明显变形',
              key: '',
            }, {
              name: '老化破损',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "设施设备",
            key:'DLSS',
            name1: "电路设施",
            value: '',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '经常跳闸',
              key: '',
            }, {
              name: '经常断电维修',
              key: '',
            }]
          },
          {
            name: "排水管道",
            value: '',
            key:'PSGD',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '老化破损',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '堵塞',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }]
          },
          {
            name: "燃气管道",
            value: '',
            key: 'RQGD',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '老化破损',
              key: '',
              child: [{
                name: '轻微',
                key: '',
              }, {
                name: '一般',
                key: '',
              }, {
                name: '严重',
                key: '',
              }]
            }, {
              name: '漏气',
              key: '',
            }]
          },
          {
            name: "场地环境",
            name1: "房屋场地",
            key: 'FWCD',
            value: '',
            child: [{
              name: '平地',
              key: '',
            }, {
              name: '山脚',
              key: '',
            }, {
              name: '悬崖',
              key: '',
            }, {
              name: '水库边',
              key: '',
            }, {
              name: '低洼地带',
              key: '',
            }, {
              name: '塌陷区',
              key: '',
            }, {
              name: '其他',
              key: 'FWCD_QT',
            }]
          },
          {
            name: "相邻施工",
            value: '',
            key: 'XLSG',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '振动',
              key: '',
            }, {
              name: '降水',
              key: '',
            }, {
              name: '土体扰动',
              key: '',
            }, {
              name: '其他',
              key: 'XLSG_QT',
            }]
          },
          {
            name: "化学侵蚀",
            value: '',
            key: 'HXQS',
            child: [{
              name: '无异常',
              key: '',
            }, {
              name: '盐酸',
              key: '',
            }, {
              name: '硫酸',
              key: '',
            }, {
              name: '海水',
              key: '',
            }, {
              name: '其他',
              key: 'HXQS_QT',
            }]
          },
          {
            name: "历史使用",
            name1: "结构拆改",
            key: 'JGCG',
            value: '',
            child: [{
              name: '无拆改',
              key: '',
            }, {
              name: '一般拆改',
              key: '',
            }, {
              name: '严重拆改',
              key: '',
            }]
          },
          {
            name: "加层改造",
            value: '',
            key: 'JCGZ',
            child: [{
              name: '无加层',
              key: '',
            }, {
              name: '加一层',
              key: '',
            }, {
              name: '加二层',
              key: '',
            }, {
              name: '加三层及以上',
              key: '',
            }]
          },
          {
            name: "修缮加固",
            key:'XSJG',
            value: '',
            child: [{
              name: '正常使用',
              key: '',
            }, {
              name: '质量原因',
              key: '',
            }, {
              name: '灾害原因',
              key: '',
            }, {
              name: '使用功能原因',
              key: '',
            }, {
              name: '其他',
              key: 'XSJG_QT',
            }]
          },
          {
            name: "历史灾害",
            value: '',
            key:'LSZH',
            child: [{
              name: '正常使用',
              key: '',
            }, {
              name: '火灾',
              key: '',
            }, {
              name: '风灾',
              key: '',
            }, {
              name: '雪灾',
              key: '',
            }, {
              name: '水灾',
              key: '',
            }, {
              name: '地质',
              key: '',
            }, {
              name: '其他',
              key: 'LSZH_QT',
            }]
          },
          {
            name: "功能变更",
            value: '',
            key:'GLBG',
            child: [{
              name: '无变更',
              key: '',
            }, {
              name: '住宅变商业用房',
              key: '',
            }, {
              name: '住宅变办公用房',
              key: '',
            }, {
              name: '办公变商业用房',
              key: '',
            }, {
              name: '工业用房变商业用房',
              key: '',
            }, {
              name: '工业用房变办公用房',
              key: '',
            }, {
              name: '其他',
              key: 'GLBG_QT',
            }]
          }],
        XCDC: [
          {
            name: '未做鉴定',
            key: 'JDQK',
          },
          {
            name: '已做鉴定',
            key: 'JDQK',
            value: '',
            child: [{
              name: '不属危险房屋',
              key: 'JDQK_YZJD',
            }, {
              name: '观察使用',
              key: '',
            }, {
              name: '处理使用',
              key: '',
            }, {
              name: '停止使用',
              key: '',
            }, {
              name: '整体拆除',
              key: '',
            }]
          }],
        ENUM: {
          JGLXARR: [],
          JGLX: false,
        },
      }
    },
    props: {
      row: Object
    },

    filters: {
      inUseName: function (msg, data) {
        let name = ''
        data.forEach(item => {
          if (item.DICID == msg) {
            name = item.DICNAME
          }
        })
        return name
      },
    },
    methods: {
      getData: async function () {
        let dataGuid = "9788c08d-3d96-4f0d-85da-d233094abcf6"
        if (this.$parent.row.NODE_GUID === '{27EE0E9F-607B-4D25-8934-3693F950C095}' || this.$parent.row.NODE_GUID === '{7A93D2DC-D4B9-4E6A-8DC6-4C2FDFBB9D45}'|| this.$parent.row.NODE_GUID === '{B4FCC404-5D84-4F9A-B5A2-243ECE2FB244}'){
          dataGuid = "81454c15-9443-443d-a7ab-f6ed4c23f46d"
        }else{
          dataGuid = "9788c08d-3d96-4f0d-85da-d233094abcf6"
        }
        let params = {
          dataguid: dataGuid,
          searchObject: JSON.stringify([{ field: 'to_row_guid', value: this.$parent.row.ROW_GUID, link: 'OR', operator: '=' }]),
          token: window.localStorage.getItem('token')
        }
        let params1 = {
          accessCode: '688bd3883572440a859dfd8ba9194e7b',
          "cityCode": window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '',
          params: params
        }
        const res = await QuerySignCallback(params1)
        let data = eval('(' + res.data.data + ')').Data[0]
        if (data){
          for (let i in this.formData){
            if (data[i]){
              if (i=='JGRQ'){
                this.formData[i] = data[i].split(" ")[0]
              }else{
                this.formData[i] = data[i]
              }

            }
          }
          console.log(this.formData.XSJG_QT)
        }
      },
      formatGetDate(val){
        let year = val.getFullYear();
        let month = val.getMonth() + 1;
        let day = val.getDate();
        let hour = val.getHours();
        let minute = val.getMinutes();
        if (month >= 1 && month <= 9) {
          month = `0${month}`;
        }
        if (day >= 1 && day <= 9) {
          day = `0${day}`;
        }
        if (hour >= 0 && hour <= 9) {
          hour = `0${hour}`;
        }
        if (minute >= 0 && minute <= 9) {
          minute = `0${minute}`;
        }
        let data =  `${year}-${month}-${day}`;
        return data
      },
      radioChange(data){
        //
        if (data.name=='其他'){
          // alert(1)
          if (this.formData[data.key]){
            this.formData[data.key] = ""
          }

        }
        // alert(2)
      },
      radioChange1(){
      },
      //竣工时间
      onConfirm(val) {
        this.showPickerq = false
        this.formData.JGRQ = this.formatGetDate(val)
      },
      //结构类型
      onConfirmJGLX(data) {
        this.ENUM.JGLX = false
        this.formData.JGLX = data.DICID
      },
      //获取界面所需字典值
      getEnum: async function (viewID) {
        let _this = this;
        let params = {
          dataguid: viewID,
          searchObject: JSON.stringify([]),
          token: window.localStorage.getItem('token')
        }
        let params1 = {
          accessCode: '688bd3883572440a859dfd8ba9194e7b',
         "cityCode": window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '',
          params: params
        }
        const res = await QuerySignCallback(params1)
        let data = eval('(' + res.data.data + ')').Data
        switch (viewID) {
          case "b65d1943-66f4-49b1-b759-cd9f079dc0d3":
            this.ENUM.JGLXARR = data;
            break;
          default:
            break;
        }
      },
    },
    mounted() {
      this.$nextTick(()=>{
        this.getData()
      })

      this.getEnum("b65d1943-66f4-49b1-b759-cd9f079dc0d3")
    }
  };
</script>

<style lang="scss">
  #CheckeRgister {
    .title {
      text-align: center;
      font-weight: bold;
      padding: 10px 0
    }

    .subTitle {
      height: 40px;
      line-height: 40px;
      font-size: 16px;
      font-weight: bolder;
    }

    .subTitle1 {
      color: #3f8ffc;
      margin-top: 10px;
      font-size: 16px;
    }

    .van-field {
      width: 100%;
      border-bottom: 1px solid #d2d2d2;
    }

    .vanCheckbox {
      padding: 10px 0;
      border-bottom: 1px solid #d2d2d2;
    }

    .van-radio {
      margin: 0 6px;
      align-items: flex-start;
    }

    .van-radio--horizontal {
      margin-right: 0;
    }

    .van-radio__label {
      margin-left: 2px;
    }
  }
</style>
